package fr.afcepf.ai89.esharing.data;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import fr.afcepf.ai89.esharing.entity.LibelleSousAvis;
import fr.afcepf.ai89.esharing.entity.MotivationAnnulation;

@Stateless
public class DAOMotivationAnnulation implements IDAOMotivationAnnulation {

	@PersistenceContext(unitName = "ESharingPhase22")
	EntityManager em;

	@Override
	public MotivationAnnulation getMotAnnul(int idMotAnnul) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<MotivationAnnulation> getMotsAnnuls() {
		
		Query hql = em.createQuery("SELECT ma FROM MotivationAnnulation ma");

		List<MotivationAnnulation> listeMa = (List<MotivationAnnulation>)hql.getResultList();
		
		return listeMa;

	}

	@Override
	public int addMotAnnul(MotivationAnnulation motAnnul) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int majMotAnnul(MotivationAnnulation motAnnul) {
		// TODO Auto-generated method stub
		return 0;
	}

}
